package week9.q4;

public class Test {
    public static void main(String[] args) {
    Vehicle vehicle[]=new Vehicle[3];
    Developer developer= new Developer("小陈",20) ;
    vehicle [0]=new Bicyle("黑色","捷安特");
    vehicle [1]=new ElectricVehicle("黄色","小牛");
    vehicle [2]=new Car("红色","法拉利","918");
        System.out.println("姓名：" + developer.getName()+"\n年龄: "+ developer.getAge());
        for (int i = 0; i < vehicle.length; i++) {

            developer.takingVehicle(vehicle[i]);


            if (vehicle[i] instanceof IPower) {
                ((IPower) vehicle[i]).power();
            }
        }


    }
}
